@import '_vars.scss';
@import '_mixins.scss';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system,BlinkMacSystemFont,PingFang SC,Microsoft Yahei,Arial;
    color: $cmdbTextColor;
    background-color: #FAFBFD;
}

ul,
dl {
    list-style: none;
}

a,
a:hover,
a:active,
a:visited,
a:focus {
    text-decoration: none;
    color: $cmdbTextColor;
}

.clearfix {
    zoom: 1;

    &:before,
    &:after {
        content: "";
        display: table;
        clear: both;
    }
}

.fl {
    float: left;
}

.fr {
    float: right;
}

[class*='icon-'] {
    display: inline-block;
    vertical-align: middle;
}

[hidden] {
    display: none;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #c3cdd7;
    font-size: 14px;
}

[class^="icon-cc"], [class*=" icon-cc"] {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'bk-cmdb' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.inline-block-middle {
    display: inline-block;
    vertical-align: middle;
    outline: 0;
}

.bgc-white {
    background-color: #fff;
}

div.cmdb-form-item {
    position: relative;
    display: inline-block;
    width: 100%;

    &.is-error {
        input.cmdb-form-input {
            border-color: $cmdbDangerColor;
        }

        .form-error {
            position: absolute;
            top: 100%;
            left: 0;
            font-size: 12px;
            line-height: 14px;
            color: $cmdbDangerColor;
            max-width: 100%;
            @include ellipsis;
        }
    }

}

input.cmdb-form-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid $cmdbBorderColor;
    border-radius: 2px;
    outline: none;

    &:focus {
        border-color: $cmdbBorderFocusColor;
    }

    &:disabled {
        background-color: #fafafa;
        color: #aaa;
        cursor: not-allowed;
    }
}

.cmdb-form-checkbox {
    font-size: 0;
    color: #737987;
    margin-right: 30px;
    line-height: 18px;
    display: inline-block;
    padding: 7px 0;
    font-size: 0;

    .cmdb-checkbox-text {
        display: inline-block;
        font-style: normal;
        font-weight: normal;
        font-size: 14px;
        cursor: pointer;
        vertical-align: middle;
        font-size: 14px;
        @include ellipsis;
    }

    input[type=checkbox] {
        width: 18px;
        height: 18px;
        outline: none;
        visibility: visible;
        cursor: pointer;
        vertical-align: middle;
        background: #fff;
        background-image: url('../images/checkbox-sprite.png');
        display: inline-block;
        background-position: 0 -62px;
        -webkit-appearance: none;
        margin: 0 5px 0 0;

        &:checked {
            background-position: -33px -62px;

            &[disabled] {
                color: #ccc;
                background-position: -99px -62px;
            }
        }

        &[disabled] {
            background-position: -66px -62px;
            cursor: default;

            &+.bk-checkbox-text {
                color: #ccc;
                cursor: default;
            }
        }
    }

    &.cmdb-checkbox-small {
        input[type=checkbox] {
            width: 14px;
            height: 14px;
            background-position: 0 -95px;

            &:checked {
                background-position: -33px -95px;

                &[disabled] {
                    background-position: -99px -95px;
                }
            }

            &[disabled] {
                background-position: -66px -95px;
            }
        }
    }
}

.cmdb-form-radio {
    font-size: 14px;
    color: #737987;
    margin-right: 30px;
    line-height: 18px;
    display: inline-block;
    padding: 7px 0;

    .cmdb-radio-text {
        font-style: normal;
        font-weight: normal;
        cursor: pointer;
        vertical-align: middle;
    }

    input[type=radio] {
        width: 18px;
        height: 18px;
        outline: none;
        visibility: visible;
        cursor: pointer;
        vertical-align: middle;
        background-color: #fff;
        background-image: url('../images/checkbox-sprite.png');
        display: inline-block;
        background-position: 0 0;
        -webkit-appearance: none;

        margin: 0 5px 0 0;

        &:checked {
            background-position: -33px 0;

            &[disabled] {
                color: #ccc;
                background-position: -99px 0;
            }
        }

        &[disabled] {
            background-position: -66px 0;
            cursor: default;

            &+.bk-radio-text {
                color: #ccc;
                cursor: default;
            }
        }
    }

    &.cmdb-radio-small {
        input[type=radio] {
            width: 14px;
            height: 14px;
            background-position: 0 -33px;

            &:checked {
                background-position: -33px -33px;

                &[disabled] {
                    background-position: -99px -33px;
                }
            }

            &[disabled] {
                background-position: -66px -33px;
            }
        }
    }
}

.icon-triple-dot {
    display: inline-block;
    vertical-align: middle;
    width: 4px;
    height: 4px;
    background-color: #bec6de;
    box-shadow: 0 5px 0 #bec6de, 0 -5px 0 #bec6de;
}

.text-primary {
    color: #3c96ff !important;

    -webkit-appearance: none;
    border: none;
    outline: 0;
    background-color: transparent;
    cursor: pointer;
    &:hover {
        color: #0082ff !important;
    }

    &.disabled,
    &:disabled {
        color: #c4c6cc !important;
        cursor: not-allowed !important;
    }
}

.text-danger {
    color: #ff5656;

    &:hover {
        color: #f72239;
    }

    &.disabled,
    &:disabled {
        opacity: .385;
        cursor: not-allowed !important;
    }
}

.color-danger {
    color: #ff5656;
}
.color-warning {
    color: #ffb400;
}
.color-success {
    color: #30d878;
}

.mask {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.collapse-transition {
    transition: .2s height ease-in-out, .2s padding-top ease-in-out, .2s padding-bottom ease-in-out
}

/* form-error -----------start----------- */

.form-component.error {

    input[name="date-select"],
    .bk-selector-input,
    .form-int-input,
    .form-float-input,
    .form-longchar-input,
    .form-singlechar-input,
    .member-container {
        border-color: #ff5566 !important;
    }
}


/* form-error -----------end----------- */


.v-cursor {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 12px 16px;
    background-image: url("../images/lock.svg");
}

.v-overflow-tips-theme {
    word-break: break-all;
}
